<template>
	<div id="app">
		<router-view />
	</div>
</template>
<script>
import baseInfo from "@/utils/config/baseInfo.json";
import {system_companyInfo} from "@/utils/request/api";
export default {
	name: "App",
	data() {
		return {
			baseInfo: baseInfo,
		};
	},
  created() {
    this.getOem();
    // 设置title
    document.title = this.baseInfo.loginTitle;
	},
	mounted() {
		// 添加全局监听点击事件
		window.addEventListener("click", (e) => { 
			console.log(e)
			// 如果点击的是弹窗的x
			if (e.target._prevClass == "wj-icon-guanbi") { 
				// 清除input红色样式（错误样式）
				var tipArr = e.target.parentNode.nextElementSibling.getElementsByClassName("tip_el")
				Array.from(tipArr).forEach(el => { 
					el.classList.remove("tip_el");
				})
				// 清除input提示文字（错误后的提示文字）
				var msgArr = e.target.parentNode.nextElementSibling.getElementsByClassName("tip_msg")
				Array.from(msgArr).forEach(el => {
					el.parentNode.removeChild(el.parentNode.lastChild)
				});
			}
			if (e.target._prevClass == "el-link--inner") { 
				console.log("*******")
				console.log(document.querySelector(".alertBox"))
				console.log(document.querySelectorAll(".alertBox"))
				Array.from(document.querySelectorAll(".alertBox")).forEach(el => {
					Array.from(el.getElementsByClassName("tip_el")).forEach(ele => { 
						ele.classList.remove("tip_el");
					})
				});
				Array.from(document.querySelectorAll(".alertBox")).forEach(el => {
					Array.from(el.getElementsByClassName("tip_msg")).forEach(ele => { 
						ele.parentNode.removeChild(ele.parentNode.lastChild)
					})
				});
				console.log("*******")
			}
		});
	},
	methods: {
    async getOem(){
      await system_companyInfo().then(res => {
        if (res.code === 200) {
          this.baseInfo = res.data;
        }
      });
    }
  },
};
</script>

<style lang="less">
#app {
	font-family: Avenir, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	width: 100%;
	height: 100%;
	background: #ffffff;
	.tableRowClassName {
		height: 58px;
	}
}
/*继续操作弹窗*/
.el-message-box {
	width: 480px !important;
	padding-bottom: 0;
}
.el-message-box .el-message-box__header {
	padding: 20px;
}
.el-message-box .el-message-box__btns {
	padding: 10px 20px;
}
.el-message-box .el-message-box__title {
	font-size: 22px !important;
}
.el-message-box .el-message-box__message {
	font-size: 16px !important;
}
.el-message-box .el-button--small {
	font-size: 14px;
}

/*图片放大相关
.el-image-viewer__img{
	transform: scale(0.8) rotate(0deg)!important;
}
*/
</style>
